package org.zhouhe.vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * ArticleArticleType entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "article_article_type", catalog = "zpd0t1_db")
public class ArticleArticleType implements java.io.Serializable {

	// Fields

	private static final long serialVersionUID = 2977154821052478898L;
	private Integer articleArticleTypeId;
	private ArticleType articleType;
	private Article article;

	// Constructors

	/** default constructor */
	public ArticleArticleType() {
	}

	/** full constructor */
	public ArticleArticleType(ArticleType articleType, Article article) {
		this.articleType = articleType;
		this.article = article;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "article_article_type_id", unique = true, nullable = false)
	public Integer getArticleArticleTypeId() {
		return this.articleArticleTypeId;
	}

	public void setArticleArticleTypeId(Integer articleArticleTypeId) {
		this.articleArticleTypeId = articleArticleTypeId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "article_type_id")
	public ArticleType getArticleType() {
		return this.articleType;
	}

	public void setArticleType(ArticleType articleType) {
		this.articleType = articleType;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "article_id")
	public Article getArticle() {
		return this.article;
	}

	public void setArticle(Article article) {
		this.article = article;
	}

}